<template>
  <div>
    <Upload
        multiple
        type="drag"
        name="avatar"
        action="http://localhost:3000/upload/uploads">
        <div style="padding: 20px 0">
            <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
            <p>点击或将文件拖拽到这里上传</p>
        </div>
    </Upload>
    <Table border :columns="columns1" :data="list"></Table>
        <Page :total="filter.total" show-elevator show-total size="small"  show-sizer :page-size-opts="[2,4,8,10]" @on-page-size-change="changePageSize" :page-size="2" @on-change="changePage" ></Page>
 </div>
</template>
<script>
import Base from '../../common/base.js';
    export default {
        mixins:[Base],
        data () {
            return {
                module:'upload',
                columns1: [
                    {
                        title: '图片名',
                        key: 'originalname'
                    },
                    {
                        title: '格式',
                        key: 'encoding'
                    },
                    {
                        title: '路径',
                        key: 'path'
                    },
                    {
                        title: '大小',
                        key: 'size'
                    },
                    {
                        title: '时间',
                        key: 'date'
                    },
                    {
                        title: '操作',
                        key: 'action',
                        fixed: 'right',
                        width: 120,
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'text',
                                        size: 'small'
                                    },
                                    on:{
                                      click:()=>{
                                        this.deleteData(params.row._id);
                                        this.getData();
                                      }
                                    }
                                }, '删除')
                            ]);
                        }
                    }
                ],
                 id:'',
            }
        }
    }
</script>